home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
tarsrc Folder
/
tar.h
< prev
next >
Wrap
Text File
|
1993-11-28
|
5KB
|
191 lines
#ifndef USEDUMP
#include <Types.h>
#include <Quickdraw.h>
#include <Fonts.h>
#include <OSEvents.h>
#include <Controls.h>
#include <Windows.h>
#include <Menus.h>
#include <TextEdit.h>
#include <Dialogs.h>
#include <Desk.h>
#include <ToolUtils.h>
#include <OSUtils.h>
#include <Scrap.h>
#include <Packages.h>
#include <Lists.h>
#include <Files.h>
#include <Memory.h>
#include <Printing.h>
#include <Errors.h>
#ifndef EOF
#define EOF (-1L)
#endif
#define DIRECTORY(pb) (((pb).hFileInfo.ioFlAttrib & ioDirMask) == ioDirMask)
/*
* Character definitions
*/
#define ENTER 0x03
#define BS 0x08
#define TAB 0x09
#define LF 0x0a
#define RETURN 0x0d
/*
* Difference between Mac and Unix times
*/
#define TIMEDIFF 0x7c25b080
/*
* Global Variables
*/
typedef struct {
int unit; /* SCSI ID for tape */
int minTO; /* Minimum timeout for any command (secs) */
int motionTO; /* Minimum timeout for tape motion (secs) */
int rewindTO; /* Rewind timeout (secs) */
Boolean forceVariable; /* Always run in variable block mode */
Boolean forceModeSelect; /* Always do a mode select */
int densityCode; /* Density code for mode select */
int speed; /* Speed code for mode select */
int bufMode; /* Buffered mode for mode select */
} TapeVars;
extern struct pref {
Boolean autoPage; /* List by screenfulls */
Boolean cvtNl; /* Convert newline to return and back */
Boolean dosCvt; /* Convert DOS style newlines (extract only) */
Boolean doPrint; /* List to printer */
Boolean floppy; /* Use a floppy as the archive file */
Boolean oldArch; /* Old tar compatible */
int blocking; /* Size of each block, in records */
int blockSize; /* Size of each block, in bytes */
char creator[4]; /* Finder Creator */
char type[4]; /* Finder Type */
Boolean doOverWrite; /* Force overwrite of existing files */
Boolean tape; /* Use a tape drive as the archive file */
TapeVars tapeVars; /* Tape specific options */
} pref;
extern Boolean doneFlag;
extern Boolean menusOK;
extern Boolean pOpen;
extern char header[];
extern THPrint prRecHdl;
/*
* Standard File and GetDir saved outputs
*/
extern long dirDirID;
extern short dirVRefNum;
/*
* External routines
*/
extern Boolean CmdFile();
extern Boolean GetDir();
extern Boolean MenuInit();
extern Boolean PrSetup();
extern Boolean WindInit();
extern Boolean StopGoAlert(const char *);
extern void GenericAlert(const char *);
/*
* Remainder taken from:
* Header file for public domain tar (tape archive) program.
*
* @(#)tar.h 1.20 86/10/29 Public Domain.
*
* Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
*/
/*
* Header block on tape.
*
* I'm going to use traditional DP naming conventions here.
* A "block" is a big chunk of stuff that we do I/O on.
* A "record" is a piece of info that we care about.
* Typically many "record"s fit into a "block".
*/
#define RECORDSIZE 512
#define NAMSIZ 100
#define TUNMLEN 32
#define TGNMLEN 32
union record {
char charptr[RECORDSIZE];
struct header {
char name[NAMSIZ];
char mode[8];
char uid[8];
char gid[8];
char size[12];
char mtime[12];
char chksum[8];
char linkflag;
char linkname[NAMSIZ];
char magic[8];
char uname[TUNMLEN];
char gname[TGNMLEN];
char devmajor[8];
char devminor[8];
} header;
};
/* The checksum field is filled with this while the checksum is computed. */
#define CHKBLANKS " " /* 8 blanks, no null */
/* The magic field is filled with this if uname and gname are valid. */
#define TMAGIC "ustar " /* 7 chars and a null */
/* The linkflag defines the type of file */
#define LF_OLDNORMAL '\0' /* Normal disk file, Unix compat */
#define LF_NORMAL '0' /* Normal disk file */
#define LF_LINK '1' /* Link to previously dumped file */
#define LF_SYMLINK '2' /* Symbolic link */
#define LF_CHR '3' /* Character special file */
#define LF_BLK '4' /* Block special file */
#define LF_DIR '5' /* Directory */
#define LF_FIFO '6' /* FIFO special file */
#define LF_CONTIG '7' /* Contiguous file */
/* Further link types may be defined later. */
/*
* Global variables
*/
extern Boolean reblock;
/*
* We now default to Unix Standard format rather than 4.2BSD tar format.
* The code can actually produce all three:
* standard ANSI standard
* oldarch V7
* neither 4.2BSD
* but we don't bother, since 4.2BSD can read ANSI standard format anyway.
* The only advantage to the "neither" option is that we can cmp(1) our
* output to the output of 4.2BSD tar, for debugging.
*/
#define standard (!pref.oldArch)
extern short archive; /* File descriptor for archive file */
/*
* Declarations of functions available to the world.
*/
union record *FindRec();
void UseRec();
union record *EndOfRecs();
Boolean OpenArchive();
#ifdef MAKEDUMP
#pragma dump "hdrs.dmp"
#endif
#else
#pragma load "hdrs.dmp"
#endif